package com.dengyin2000.javaeye.ordering.action;

import java.io.Serializable;

import org.hibernate.Session;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;

import com.dengyin2000.javaeye.ordering.entity.Dish;

@Name("viewDishAction")
public class ViewDishAction implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3797381891907916624L;

	private Long dishId;
	
	private Dish dish;

	public Long getDishId() {
		return dishId;
	}

	public void setDishId(Long dishId) {
		this.dishId = dishId;
	}
	
	@In("orderingDatabase")
	private Session session;
	
	public void loadDish() {
		dish = (Dish) session.load(Dish.class, getDishId());
	}

	public Dish getDish() {
		return dish;
	}
	
}
